﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using SingleUserMall.Authorization.Users;
using SingleUserMall.Users.VO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.Items.VO
{
    /// <summary>
    /// 砍价商品
    /// </summary>
    [AutoMapFrom(typeof(ItemBargain))]
    public class ItemBarginVO:EntityDto<long>
    {
        internal User inUser { get; set; }
        /// <summary>
        /// 发起人头像
        /// </summary>
        public string Avatar => inUser?.Avatar;
        /// <summary>
        /// 发起人姓名
        /// </summary>
        public string Name => inUser?.Name;
        /// <summary>
        /// 已达到的砍价价格
        /// </summary>
        public decimal ActualBargainPrice { get; set; }
        /// <summary>
        /// 已砍价次数
        /// </summary>
        public int ActualBargainTimes { get; set; }
        /// <summary>
        /// 已砍价格
        /// </summary>
        public decimal ReducedPrice { get; set; }
        /// <summary>
        /// 参与砍价人列表
        /// </summary>
        public IReadOnlyList<UserMiniVO> BargainUsers { get; set; }
        /// <summary>
        /// 砍价结束
        /// </summary>
        public bool IsOver { get; set; }
        /// <summary>
        /// 已经砍到底价
        /// </summary>
        public bool IsDown { get; set; }
        /// <summary>
        /// 是否是发起者
        /// </summary>
        public bool IsStart { get; set; }
        /// <summary>
        /// 发起砍价时间
        /// </summary>
        public DateTime CreationTime { get; set; }
    }
}
